﻿create procedure [dbo].[usp_WorkItemDelete]
	-- @TeamFoundationServerId required to avoid entity framework mapping error 2048 (.net framework 3.5 SP1)
	@TeamFoundationServerId int = null
	, @WorkItemId int
as

begin try
	begin transaction
	
	delete from [dbo].[WorkItem] where [WorkItemId] = @WorkItemId
	
	commit transaction
end try

begin catch
	if @@trancount > 0
	begin
		rollback transaction
	end
	execute [dbo].[usp_SqlErrorInsert]
end catch